<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('@sf_guard_signin') ?>" method="post">
  <table>
    <thead>
      <tr>
        <td colspan="2">
          <?php echo $form->renderGlobalErrors() ?>
        </td>
      </tr>
    </thead>
    <tbody>
      <?php foreach ($form as $field) : ?>
        <?php if (!$field->isHidden()) : ?>
          <tr>
            <th>
              <?php echo $field->renderLabel() ?>
            </th>
            <td>
              <?php echo $field->render() ?>
              <?php echo $field->renderError() ?>
            </td>
          </tr>
        <?php else : ?>
          <?php echo $field->render() ?>
        <?php endif ?>
      <?php endforeach ?>
    </tbody>
    <tfoot>
      <tr>
        <td colspan="2">
          <input type="submit" value="<?php echo __('Sign in') ?>" />

          <?php $routes = $sf_context->getRouting()->getRoutes() ?>
          <?php if (isset($routes['sf_guard_forgot_password'])): ?>
            <a href="<?php echo url_for('@sf_guard_forgot_password') ?>"><?php echo __('Forgot your password?') ?></a>
          <?php endif; ?>

          <?php if (isset($routes['sf_guard_register'])): ?>
            &nbsp; <a href="<?php echo url_for('@sf_guard_register') ?>"><?php echo __('Want to register?') ?></a>
          <?php endif; ?>
        </td>
      </tr>
    </tfoot>
  </table>
</form>